// cf-632e
// 题意：
// 有n(<=1000)种商品，每种商品都是无限数量，一个商品的费用是ai(<=1000)，
// 现在问拿恰好k(<=1000)个商品，所有可能的费用有哪些？
//
// 题解：
// 所有商品可以写成一个多项式，f(x)=sigma(x^ai)，那么取恰好k个商品就是
// f(x)^k 中系数不为零的，对这个多项式做一个快速幂就行，复杂度O(n*logn*logk)。
// 这里有一些优化，就是多项式长度不用超过1000^2，然后系数也只需要0或1就行。
//
// run: time -p $exec < input > out
#include <iostream>
#include <complex>
#include <algorithm>
#include <cmath>

int const maxn = 1007;
int const maxm = 1000007 * 4;
int res[maxm], a[maxm];
int da[maxn];
int n, k;

namespace fft
{
	using base = std::complex<long double>;
	long double const pi = std::acos(-1);

	int rev[maxm];
	base wlen_pw[maxm];

	void fft(base a[], int n, bool invert)
	{
		for (int i = 0; i < n; i++)
			if (i < rev[i]) std::swap(a[i], a[rev[i]]);

		for (int len = 2; len <= n; len *= 2) {
			long double ang = (2 * pi / len) * (invert ? -1 : 1);
			int len2 = len / 2;
			base wlen(std::cos(ang), std::sin(ang));
			wlen_pw[0] = base(1, 0);
			for (int i = 1; i < len2; i++)
				wlen_pw[i] = wlen_pw[i - 1] * wlen;

			for (int i = 0; i < n; i += len) {
				base t, *pu = a + i, *pv = a + i + len2, *pu_end = a + i + len2, *pw = wlen_pw;
				for (; pu != pu_end; ++pu, ++pv, ++pw) {
					t = *pv * *pw;
					*pv = *pu - t;
					*pu += t;
				}
			}
		}

		if (!invert) return;
		for (int i = 0; i < n; i++) a[i] /= n;
	}

	base fa[maxm], fb[maxm];
	int calc_last = -1;

	void calc_rev(int n)
	{
		if (n == calc_last) return;
		int logn = 0;
		while ((1 << logn) < n) logn++;
		for (int i = 0; i < n; i++) {
			rev[i] = 0;
			for (int j = 0; j < logn; j++)
				if (i & (1 << j))
					rev[i] |= 1 << (logn - j - 1);
		}
		calc_last = n;
	}

	void self_multiply(int a[], int n1, int res[], int & len)
	{
		int n = 1;
		while (n < n1) n *= 2;
		n *= 2; len = n;

		for (int i = 0; i < n1; i++) fa[i] = a[i];
		for (int i = n1; i < n; i++) fa[i] = 0;

		calc_rev(n);
		fft(fa, n, false);
		for (int i = 0; i < n; i++) fa[i] *= fa[i];
		fft(fa, n, true);

		for (int i = 0; i < n; i++)
			res[i] = std::round(fa[i].real());
	}

	void multiply(int a[], int n1, int b[], int n2, int res[], int & len)
	{
		int n = 1;
		while (n < std::max(n1, n2)) n *= 2;
		n *= 2; len = n;

		for (int i = 0; i < n1; i++) fa[i] = a[i];
		for (int i = 0; i < n2; i++) fb[i] = b[i];
		for (int i = n1; i < n; i++) fa[i] = 0;
		for (int i = n2; i < n; i++) fb[i] = 0;

		calc_rev(n);
		fft(fa, n, false); fft(fb, n, false);
		for (int i = 0; i < n; i++) fa[i] *= fb[i];
		fft(fa, n, true);

		for (int i = 0; i < n; i++)
			res[i] = std::round(fa[i].real());
	}

	void quick_fft(int a[], int n, int k, int res[], int & len)
	{
		len = 1; res[0] = 1;
		while (k > 0) {
			if (k & 1) multiply(res, len, a, n, res, len);
			self_multiply(a, n, a, n);
			n = std::min(n, 1000007);
			while (!a[n - 1]) n--;
			len = std::min(len, 1000007);
			while (!res[len - 1]) len--;
			for (int i = 0; i < len; i++)
				res[i] = bool(res[i]);
			for (int i = 0; i < n; i++)
				a[i] = bool(a[i]);
			k /= 2;
		}
	}
}

int main()
{
	std::ios_base::sync_with_stdio(false);
	std::cin >> n >> k;
	int max = 0;
	for (int i = 0; i < n; i++) {
		std::cin >> da[i];
		max = std::max(max, da[i]);
		a[da[i]] = 1;
	}
	int len;
	fft::quick_fft(a, max + 1, k, res, len);
	for (int i = 0; i < len; i++)
		if (res[i]) std::cout << i << " ";
	std::cout << "\n";
}

